#!/bin/sh
# Reload the gogoc daemon when an interface comes up.

set -e

# We don't restart for loopback
if [ "$IFACE" = lo ] ; then
  exit 0
fi

# Make sure the binary is available
if [ ! -x /usr/sbin/gogoc ]; then
  exit 0
fi

# Restart only if the daemon was running already
/usr/bin/pgrep -f ^/usr/sbin/gogoc >/dev/null
if [ $? != 0 ]; then
  exit 0
fi
invoke-rc.d gogoc restart

exit 0
